<template>
  <div class="app-container">
    <el-row>
      <el-col>
        <!--<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="商品名称" prop="name">
            <el-input v-model="queryParams.name" placeholder="请输入商品名称" clearable size="small" style="width: 240px"
                      @keyup.enter.native="handleQuery"/>
          </el-form-item>
          <el-form-item>
            <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>-->
        <el-row :gutter="24" class="mb8">
          <el-col :span="1.5">
            <el-button type="primary" size="mini" @click="handleGetOrderList">
              获取订单列表
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="primary" size="mini" @click="handlesSMSSend">
              你有{{isCommentCount}}个用户订单未评价
            </el-button>
          </el-col>
        </el-row>
        <el-row style="margin-top: 7px">
          <el-col>
            <el-form :model="formData" label-width="80px" size="mini" :inline="true">
              <el-form-item label="订单状态:">
                <el-select v-model="formData.orderStatus" placeholder="请选择订单状态">
                  <el-option
                    v-for="item in orderStatusOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="1688是否发货:">
                <el-select v-model="formData.shipStatus" placeholder="请选择是否发货">
                  <el-option
                    v-for="item in shipStatusOptions"
                    :key="item.shipValue"
                    :label="item.shipLabel"
                    :value="item.shipValue">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="收货人:">
                <el-input v-model="formData.postReceiver" placeholder="请输入收货人"></el-input>
              </el-form-item>
              <el-button type="primary" @click="formDataButton">搜索</el-button>
              <el-button type="primary" @click="clean">重置</el-button>
            </el-form>
          </el-col>
        </el-row>
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%"
          height="560px"
          @selection-change="handleSelectionChange">
          <!-- <el-table-column
             type="selection"
             width="55">
           </el-table-column>-->
          <el-table-column
            label="#"
            type="index"
            width="55">
          </el-table-column>
          <el-table-column
            prop="orderId"
            label="订单ID"
            width="200">
          </el-table-column>
          <el-table-column
            prop="shopId"
            label="店铺ID"
            width="120">
          </el-table-column>
          <el-table-column
            prop="childNum"
            label="子订单数量">
          </el-table-column>
          <el-table-column
            label="商品ID">
            <template slot-scope="scope">
              <!--{{scope.row.productId.replace(/\"/g, "")}}-->
              {{scope.row.productId === null ? null : scope.row.productId.replace(/\"/g, "")}}
            </template>
          </el-table-column>
          <el-table-column
            label="商品名称"
            width="130px">
            <template slot-scope="scope">
              <!--{{scope.row.productName.replace(/\"/g, "")}}-->
              {{scope.row.productName === null ? null : scope.row.productName.replace(/\"/g, "")}}
            </template>
          </el-table-column>
          <el-table-column
            prop="productPic"
            label="商品图片"
            width="130px">
            <template slot-scope="scope">
              <el-image
                style="width: 100px; height: 100px;"
                :src='scope.row.productPic.replace(/\"/g, "")'
              ></el-image>
            </template>
          </el-table-column>
          <el-table-column
            prop="comboId"
            label="该子订单购买的商品 sku_id"
            width="130px">
          </el-table-column>
          <el-table-column
            label="收件人地址"
            width="130px">
            <template slot-scope="scope" style="width:500px">
              {{scope.row.provinceName}}{{scope.row.cityName}}{{scope.row.townName}}{{scope.row.detail}}
            </template>
          </el-table-column>

          <el-table-column
            prop="postCode"
            label="邮政编码 ">
          </el-table-column>
          <el-table-column
            prop="postReceiver"
            label="收件人姓名">
          </el-table-column>
          <el-table-column
            prop="postTel"
            label="收件人电话 ">
          </el-table-column>
          <el-table-column
            prop="buyerWords"
            label="买家备注 ">
          </el-table-column>
          <el-table-column
            label="卖家备注">
            <template slot-scope="scope">
              <!--{{scope.row.sellerWords.replace(/\"/g, "")}}-->
              {{scope.row.sellerWords === null ? null : scope.row.sellerWords.replace(/\"/g, "")}}
            </template>
          </el-table-column>
          <el-table-column
            label="物流公司">
            <template slot-scope="scope">
              {{scope.row.logisticsId | logisticsCompany}}
            </template>
          </el-table-column>
          <el-table-column
            prop="logisticsCode"
            label="物流单号 ">
          </el-table-column>
          <el-table-column
            prop="logisticsName"
            label="1688物流公司">
          </el-table-column>
          <el-table-column
            prop="aliLogisticsId"
            label="1688物流单号 ">
          </el-table-column>
          <el-table-column
            label="发货时间 "
            width="170px">
            <template slot-scope="scope"
                      v-if='scope.row.logisticsTime == "0" || scope.row.logisticsTime == "" ? false : true'>
              {{ scope.row.logisticsTime | formatDate}}
            </template>
          </el-table-column>
          <el-table-column
            label="收货时间 "
            width="170px">
            <template slot-scope="scope"
                      v-if='scope.row.receiptTime == "0" || scope.row.receiptTime == "" ? false : true'>
              {{scope.row.receiptTime | formatDate}}
            </template>
          </el-table-column>

          <el-table-column
            label="订单状态">
            <template slot-scope="scope">
              <span v-if="scope.row.orderStatus === '1'">
               在线支付订单待支付；货到付款订单待确认
              </span>
              <span v-if="scope.row.orderStatus === '2'">
                备货中
              </span>
              <span v-if="scope.row.orderStatus === '3'">
                已发货
              </span>
              <span v-if="scope.row.orderStatus === '4'">
                已取消
              </span>
              <span v-if="scope.row.orderStatus === '5'">
                已完成
              </span>
              <span v-if="scope.row.orderStatus === '6'">
                退货中-用户申请
              </span>
              <span v-if="scope.row.orderStatus === '7'">
                退货中-商家同意退货
              </span>
              <span v-if="scope.row.orderStatus === '8'">
                退货中-客服仲裁
              </span>
              <span v-if="scope.row.orderStatus === '9'">
                已关闭-退货失败
              </span>
              <span v-if="scope.row.orderStatus === '10'">
                退货中-客服同意
              </span>
              <span v-if="scope.row.orderStatus === '11'">
                退货中-用户已填物流
              </span>
              <span v-if="scope.row.orderStatus === '12'">
                退货成功-商户同意
              </span>
              <span v-if="scope.row.orderStatus === '13'">
                退货中-再次客服仲裁
              </span>
              <span v-if="scope.row.orderStatus === '14'">
                退货中-客服同意退款
              </span>
              <span v-if="scope.row.orderStatus === '15'">
                退货-用户取消
              </span>
              <span v-if="scope.row.orderStatus === '16'">
                退款中-用户申请(备货中)
              </span>
              <span v-if="scope.row.orderStatus === '17'">
                退款中-商家同意(备货中)
              </span>
              <span v-if="scope.row.orderStatus === '21'">
                退款成功-订单退款
              </span>
              <span v-if="scope.row.orderStatus === '22'">
                退款成功-订单退款
              </span>
              <span v-if="scope.row.orderStatus === '24'">
               退货成功-商户已退款
              </span>
              <span v-if="scope.row.orderStatus === '25'">
                退款中-用户取消
              </span>
              <span v-if="scope.row.orderStatus === '26'">
               退款中-商家拒绝
              </span>
              <span v-if="scope.row.orderStatus === '27'">
              退货中-等待买家处理
              </span>
              <span v-if="scope.row.orderStatus === '28'">
              退货失败
              </span>
              <span v-if="scope.row.orderStatus === '29'">
              退货中-等待买家处理
              </span>
              <span v-if="scope.row.orderStatus === '30'">
              退款中-退款申请
              </span>
              <span v-if="scope.row.orderStatus === '31'">
              退款申请取消
              </span>
              <span v-if="scope.row.orderStatus === '32'">
              退款中-商家同意
              </span>
              <span v-if="scope.row.orderStatus === '33'">
              退款中-商家拒绝
              </span>
              <span v-if="scope.row.orderStatus === '34'">
              退款中-客服仲裁
              </span>
              <span v-if="scope.row.orderStatus === '35'">
              退款中-客服同意
              </span>
              <span v-if="scope.row.orderStatus === '36'">
              退款中-支持商家
              </span>
              <span v-if="scope.row.orderStatus === '37'">
              已关闭-退款失败
              </span>
              <span v-if="scope.row.orderStatus === '38'">
              退款成功-售后退款
              </span>
              <span v-if="scope.row.orderStatus === '39'">
              退款成功-订单退款
              </span>

            </template>
          </el-table-column>
          <el-table-column
            label="订单类型">
            <template slot-scope="scope">
              <span v-if="scope.row.orderType === '0'">
                普通订单
              </span>
              <span v-if="scope.row.orderType === '2'">
                虚拟订单
              </span>
              <span v-if="scope.row.orderType === '4'">
                电子券
              </span>
            </template>
          </el-table-column>
          <el-table-column
            prop="createTime"
            label="订单创建时间 "
            width="170px">
            <template slot-scope="scope"
                      v-if='scope.row.createTime == "0" || scope.row.createTime == "" ? false : true'>
              {{scope.row.createTime | formatDate}}
            </template>
          </el-table-column>
          <el-table-column
            prop="updateTime"
            label="订单更新时间 "
            width="170px">
            <template slot-scope="scope"
                      v-if='scope.row.updateTime == "0" || scope.row.updateTime == "" ? false : true'>
              {{scope.row.updateTime | formatDate}}
            </template>
          </el-table-column>
          <el-table-column
            prop="expShipTime"
            label="订单最晚发货时间 "
            width="170px">
            <template slot-scope="scope"
                      v-if='scope.row.expShipTime == "0" || scope.row.expShipTime == "" ? false : true'>
              {{scope.row.expShipTime | formatDate}}
            </template>
          </el-table-column>
          <el-table-column
            prop="cancelReason"
            label="订单取消原因 "
            width="130px">
          </el-table-column>
          <el-table-column
            prop="payType"
            label="支付类型">
            <template slot-scope="scope">
              <span v-if="scope.row.payType === '0'">
                货到付款
              </span>
              <span v-if="scope.row.payType === '1'">
                微信
              </span>
              <span v-if="scope.row.payType === '2'">
                支付宝
              </span>
            </template>
          </el-table-column>
          <el-table-column
            prop="payTime"
            label="支付时间 (pay_type为货到付款货到付款时, 此字段为空)"
            width="170px">
          </el-table-column>
          <el-table-column
            label="该子订单所购买的sku的售价 ">
            <template slot-scope="scope">
              {{scope.row.comboAmount | numFilter}}
            </template>
          </el-table-column>
          <el-table-column
            prop="comboNum"
            label="该子订单所购买的sku的数量 ">
          </el-table-column>
          <el-table-column
            label="邮费金额 (单位: 分) ">
            <template slot-scope="scope">
              {{scope.row.postAmount | numFilter}}
            </template>
          </el-table-column>
          <el-table-column
            label="平台优惠券金额 (单位: 分) ">
            <template slot-scope="scope">
              {{scope.row.couponAmount | numFilter}}
            </template>
          </el-table-column>
          <el-table-column
            label="商家优惠券金额 (单位: 分) ">
            <template slot-scope="scope">
              {{scope.row.shopCouponAmount | numFilter}}
            </template>
          </el-table-column>
          <el-table-column
            prop="totalAmount"
            label="订单实付金额（不包含运费） ">
            <template slot-scope="scope">
              {{scope.row.totalAmount | numFilter}}
            </template>
          </el-table-column>
          <el-table-column
            prop="isComment"
            label="是否评价 (1:已评价)">
            <template slot-scope="scope">
              {{scope.row.isComment === 1 ? '已评价': '未评价'}}
            </template>
          </el-table-column>
          <el-table-column
            label="订单APP渠道"
            width="100px">
            <template slot-scope="scope">
              <span v-if="scope.row.btype === '0'">
                站外
              </span>
              <span v-if="scope.row.btype === '1'">
                火山
              </span>
              <span v-if="scope.row.btype === '2'">
                抖音
              </span>
              <span v-if="scope.row.btype === '3'">
                头条
              </span>
              <span v-if="scope.row.btype === '4'">
                西瓜
              </span>
              <span v-if="scope.row.btype === '5'">
                微信
              </span>
              <span v-if="scope.row.btype === '6'">
                闪购
              </span>
              <span v-if="scope.row.btype === '7'">
                头条lite版本
              </span>
              <span v-if="scope.row.btype === '8'">
                懂车帝
              </span>
              <span v-if="scope.row.btype === '9'">
                皮皮虾
              </span>
              <span v-if="scope.row.btype === '11'">
                抖音极速版
              </span>
              <span v-if="scope.row.btype === '12'">
                	TikTok
              </span>
            </template>
          </el-table-column>
          <el-table-column
            prop="urgeCnt"
            label="催单次数 ">
          </el-table-column>
          <el-table-column fixed="right" label="操作" width="180">
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-upload2" @click="handleSendPhoneSMS(scope.row)">催评
              </el-button>
              <el-button v-if="scope.row.shipStatus === '1' && scope.row.orderStatus=== '2' ? true : false" size="mini"
                         type="text"
                         icon="el-icon-upload2" @click="logisticsAdd(scope.row)">发货
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>

    <!--<el-dialog
      title="发货"
      :visible.sync="dialogVisible"
      width="30%">
      <el-form :model="ruleForm" status-icon label-width="100px">
        <el-form-item label="订单ID" prop="orderId">
          <el-input type="text" v-model="ruleForm.orderId" disabled></el-input>
        </el-form-item>
        <el-form-item label="运单号" prop="logisticsCode">
          <el-input type="text" v-model="ruleForm.logisticsCode" disabled></el-input>
        </el-form-item>
        <el-form-item label="物流公司名称" prop="company">
          <el-input type="text" v-model="ruleForm.company" disabled></el-input>
        </el-form-item>
        <el-form-item label="物流公司" prop="logisticsId">
          <template>
            <el-select v-model="ruleForm.logisticsId" filterable placeholder="请选择">
              <el-option
                v-for="item in logisticsIdOptions"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
          </template>
        </el-form-item>
        <el-form-item>
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="logisticsAdd">确 定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>-->

    <el-dialog
      title="发送短信"
      :visible.sync="sendSMSDialog"
      width="30%">
      <span>是否要给{{isCommentCount}}个用户未评价的订单发送催评短信</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="sendSMSDialog = false">取 消</el-button>
        <el-button type="primary" @click="sendSMS">确 定</el-button>
      </span>
    </el-dialog>

    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pageNum"
      :page-sizes="[10, 30, 50, 100]"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
  import {formatDate} from '@/common/date'
  import ElRow from "element-ui/packages/row/src/row";
  export default {
    components: {ElRow},
    filters: {
      formatDate(time) {
        time = time * 1000
        let date = new Date(time)
        return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
      },
      numFilter(value) {
        let transformVal = Number(value / 100).toFixed(2)
        return transformVal
      },
      logisticsCompany(id){
        if (id == 0) {
          return " "
        } else if (id == 7) {
          return "圆通快递"
        } else if (id == 8) {
          return "申通快递"
        } else if (id == 9) {
          return "韵达快递"
        } else if (id == 10) {
          return "佳怡物流"
        } else if (id == 11) {
          return "优速物流"
        } else if (id == 12) {
          return "顺丰快递"
        } else if (id == 13) {
          return "德邦快递"
        } else if (id == 14) {
          return "天天快递"
        } else if (id == 15) {
          return "中通速递"
        } else if (id == 16) {
          return "全峰快递"
        } else if (id == 17) {
          return "EMS"
        } else if (id == 18) {
          return "微特派"
        } else if (id == 19) {
          return "邮政国内小包"
        } else if (id == 20) {
          return "百世汇通"
        } else if (id == 1021) {
          return "极兔速递"
        }
      }
    },
    data() {
      return {
        showSearch: true,
        isCommentCount: '',
        dialogVisible: false,
        sendSMSDialog: false,
        total: 0,
        pageNum: 1,
        pageSize: 10,
        tableData: [],
        formData: {},
        orderStatusOptions: [{
          value: '1',
          label: '在线支付订单待支付；货到付款订单待确认'
        },
          {
            value: '2',
            label: '备货中'
          },
          {
            value: '3',
            label: '已发货'
          },
          {
            value: '4',
            label: '已取消'
          },
          {
            value: '5',
            label: '已完成'
          },
          {
            value: '6',
            label: '退货中-用户申请'
          },
          {
            value: '7',
            label: '退货中-商家同意退货'
          },
          {
            value: '8',
            label: ' 退货中-客服仲裁'
          },
          {
            value: '9',
            label: '已关闭-退货失败'
          },
          {
            value: '10',
            label: '退货中-客服同意'
          },
          {
            value: '11',
            label: '退货中-用户已填物流'
          },
          {
            value: '12',
            label: '退货成功-商户同意'
          },
          {
            value: '13',
            label: '退货中-再次客服仲裁'
          },
          {
            value: '14',
            label: ' 退货中-客服同意退款'
          },
          {
            value: '15',
            label: '退货-用户取消'
          },
          {
            value: '16',
            label: '退款中-用户申请(备货中)'
          },
          {
            value: '17',
            label: '退款中-商家同意(备货中)'
          },
          {
            value: '21',
            label: '退款成功-订单退款'
          },
          {
            value: '22',
            label: '退款成功-订单退款'
          },
          {
            value: '24',
            label: '退货成功-商户已退款'
          },
          {
            value: '25',
            label: '退款中-用户取消'
          },
          {
            value: '26',
            label: '退款中-商家拒绝'
          },
          {
            value: '27',
            label: '退货中-等待买家处理'
          },
          {
            value: '28',
            label: '退货失败'
          },
          {
            value: '29',
            label: '退货中-等待买家处理'
          },
          {
            value: '30',
            label: '退款中-退款申请'
          },
          {
            value: '31',
            label: '退款申请取消'
          },
          {
            value: '32',
            label: '退款中-商家同意'
          },
          {
            value: '33',
            label: '退款中-商家拒绝'
          },
          {
            value: '34',
            label: ' 退款中-客服仲裁'
          },
          {
            value: '35',
            label: '退款中-客服同意'
          },
          {
            value: '36',
            label: '退款中-支持商家'
          },
          {
            value: '37',
            label: '已关闭-退款失败'
          },
          {
            value: '38',
            label: ' 退款成功-售后退款'
          },
          {
            value: '39',
            label: '退款成功-订单退款'
          }],
        logisticsIdOptions: [{
          id: '',
          name: ''
        }],
        shipStatusOptions: [{
          shipValue: '0',
          shipLabel: '未发货'
        },
          {
            shipValue: '1',
            shipLabel: '已发货'
          }],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          name: ''
        },
        ruleForm: {}
      }
    },
    created() {
      this.handleGetIsCommentCount();
      this.handleGetOrderList();
    },
    methods: {
      toggleSelection(rows) {
        if (rows) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row);
          });
        } else {
          this.$refs.multipleTable.clearSelection();
        }
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
        this.pageSize = val
        this.pageNum = 1
        this.handleGetOrderList()
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.pageNum = val
        this.handleGetOrderList()
      },
      handleQuery() {

      },
      resetQuery() {
        this.queryParams = {}
      },
      async handleGetIsCommentCount(){
        await this.$http.get(`/douyin/order/getIsCommentCount`)
          .then((response) => {
            var result = response.data.dataMap.data;
            this.isCommentCount = result;
            console.log(this.isCommentCount)
          })
      },
      async handleSendPhoneSMS(val){
        await this.$http
          .post(`/douyin/order/sendPhoneSMS/${val.postTel}`)
          .then((response) => {
            var result = response.data;
            this.$message({message: result.message, type: "success"});
          })
      },
      handlesSMSSend() {
        this.sendSMSDialog = true
      },
      async sendSMS(){
        await this.$http
          .post(`/douyin/order/sendSMS`)
          .then((response) => {
            var result = response.data;
            console.log(result)
            this.$message({message: result.message, type: "success"});
          })
      },
      async handleGetOrderList(){
        await this.$http
          .post(`/douyin/order/getSQLOrderList/${this.pageNum}/${this.pageSize}`, this.formData)
          .then((response) => {
            var result = response.data.dataMap.data;
            this.tableData = result.records;
            this.total = result.total;
            console.log(this.tableData)
          })
      },
      formDataButton(){
        console.log('orderStatusValue', this.formData)
        this.handleGetOrderList()
      },
      clean(){
        this.formData = {}
        this.handleGetOrderList()
      },
      /** 打开发货页面*/
      /*handleLogisticsAdd(val){
       console.log('val', val)
       /!** 查询ali订单物流表*!/
       await this.$http
       .get(`/aliOrderLogistics/getLogisticsAdd/${val.orderId}`)
       .then((response) => {
       var result = response.data.dataMap.data
       console.log(result)
       if (result === null) {
       this.dialogVisible = false
       this.$message.error('没有此订单信息')
       } else {
       this.dialogVisible = true
       this.ruleForm.logisticsCode = result.logisticsId
       this.ruleForm.company = result.logisticsName
       this.ruleForm.orderId = val.orderId
       var companyIdList = []
       var companyNameList = []
       /!** 获取物流公司名称*!/
       await this.$http
       .get(`/douyin/order/logisticsCompanyList`)
       .then((response) => {
       var result = response.data.message;
       var company = JSON.parse(result)
       this.logisticsIdOptions = company.data
       this.logisticsIdOptions.forEach((item, index) => {
       var company = this.ruleForm.company.substring(0, 2)
       if (company === item.name.substring(0, 2)) {
       companyIdList.push(item.id)
       companyNameList.push(item.name)
       }
       })
       //id
       console.log(companyIdList)
       console.log(companyIdList[0])
       this.ruleForm.logisticsId = companyIdList[0]
       //name
       console.log(companyNameList)
       console.log(companyNameList[0])
       })
       }
       })
       },*/
      /** 发货*/
      async logisticsAdd(val){
        console.log('val', val)
        /** 查询ali订单物流表*/
        await this.$http
          .get(`/aliOrderLogistics/getLogisticsAdd/${val.orderId}`)
          .then((response) => {
              var result = response.data.dataMap.data
              console.log('有没有此订单', result)
              if (result === null) {
                this.$message.error('没有此订单信息')
              } else {
                this.ruleForm.logisticsCode = result.logisticsId
                this.ruleForm.company = result.logisticsName
                this.ruleForm.orderId = val.pid
                var companyIdList = []
                var companyNameList = []
                /** 获取物流公司名称*/
                this.$http
                  .get(`/douyin/order/logisticsCompanyList`)
                  .then((response) => {
                      var result = response.data.message;
                      var company = JSON.parse(result)
                      this.logisticsIdOptions = company.data
                      this.logisticsIdOptions.forEach((item, index) => {
                        var company = this.ruleForm.company.substring(0, 2)
                        if (company === item.name.substring(0, 2)) {
                          companyIdList.push(item.id)
                          companyNameList.push(item.name)
                        }
                      })
                      //id
                      console.log(companyIdList)
                      console.log(companyIdList[0])
                      this.ruleForm.logisticsId = companyIdList[0]
                      console.log('logisticsId', this.ruleForm.logisticsId)
                      //name
                      console.log(companyNameList)
                      console.log(companyNameList[0])
                      console.log(this.ruleForm.orderId)

                      this.$http
                        .post(`/douyin/order/orderLogisticsAdd`, this.ruleForm)
                        .then((response) => {
                          console.log(response)
                          var result = response.data;
                          var res = JSON.parse(result.message)
                          if (res.err_no === 7) {
                            this.$message.error(res.message)
                          } else if (res.err_no === 0) {
                            this.$message.success('发货成功')
                            this.ruleForm = {}
                            this.$http
                              .post(`/douyin/order/getOrderOne/${val.pid}`)
                              .then((response) => {
                                this.handleGetOrderList();
                              })
                          }
                          console.log('result', result)
                        })
                    }
                  )
              }
            }
          )
      },
      handleUpload1688()
      {
        console.log('2')
      }
    }
  }
</script>

<style>

</style>
